3.4.75 \(\int (b \cos (c+d x))^n (A+B \cos (c+d x)+C \cos ^2(c+d x)) \sec ^3(c+d x) \, dx\) [375]

3.4.75.1 Optimal result
3.4.75.2 Mathematica [A] (verified)
3.4.75.3 Rubi [A] (verified)
3.4.75.4 Maple [F]
3.4.75.5 Fricas [F]
3.4.75.6 Sympy [F(-1)]
3.4.75.7 Maxima [F]
3.4.75.8 Giac [F]
3.4.75.9 Mupad [F(-1)]

3.4.75.1 Optimal result

Integrand size = 39, antiderivative size = 194 \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=-\frac {b^2 C (b \cos (c+d x))^{-2+n} \sin (c+d x)}{d (1-n)}+\frac {b^2 (A (1-n)+C (2-n)) (b \cos (c+d x))^{-2+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-2+n),\frac {n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{d (1-n) (2-n) \sqrt {\sin ^2(c+d x)}}+\frac {b B (b \cos (c+d x))^{-1+n} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-1+n),\frac {1+n}{2},\cos ^2(c+d x)\right ) \sin (c+d x)}{d (1-n) \sqrt {\sin ^2(c+d x)}} \]

output
-b^2*C*(b*cos(d*x+c))^(-2+n)*sin(d*x+c)/d/(1-n)+b^2*(A*(1-n)+C*(2-n))*(b*c 
os(d*x+c))^(-2+n)*hypergeom([1/2, -1+1/2*n],[1/2*n],cos(d*x+c)^2)*sin(d*x+ 
c)/d/(n^2-3*n+2)/(sin(d*x+c)^2)^(1/2)+b*B*(b*cos(d*x+c))^(-1+n)*hypergeom( 
[1/2, -1/2+1/2*n],[1/2+1/2*n],cos(d*x+c)^2)*sin(d*x+c)/d/(1-n)/(sin(d*x+c) 
^2)^(1/2)
 
3.4.75.2 Mathematica [A] (verified)

Time = 0.24 (sec) , antiderivative size = 150, normalized size of antiderivative = 0.77 \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\frac {(b \cos (c+d x))^n \csc (c+d x) \sec ^2(c+d x) \left (-\left ((C (-2+n)+A (-1+n)) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-2+n),\frac {n}{2},\cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}\right )+(-2+n) \left (C \sin ^2(c+d x)-B \cos (c+d x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (-1+n),\frac {1+n}{2},\cos ^2(c+d x)\right ) \sqrt {\sin ^2(c+d x)}\right )\right )}{d (-2+n) (-1+n)} \]

input
Integrate[(b*Cos[c + d*x])^n*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c 
 + d*x]^3,x]
 
output
((b*Cos[c + d*x])^n*Csc[c + d*x]*Sec[c + d*x]^2*(-((C*(-2 + n) + A*(-1 + n 
))*Hypergeometric2F1[1/2, (-2 + n)/2, n/2, Cos[c + d*x]^2]*Sqrt[Sin[c + d* 
x]^2]) + (-2 + n)*(C*Sin[c + d*x]^2 - B*Cos[c + d*x]*Hypergeometric2F1[1/2 
, (-1 + n)/2, (1 + n)/2, Cos[c + d*x]^2]*Sqrt[Sin[c + d*x]^2])))/(d*(-2 + 
n)*(-1 + n))
 
3.4.75.3 Rubi [A] (verified)

Time = 0.65 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.01, number of steps used = 8, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.205, Rules used = {3042, 2030, 3502, 25, 3042, 3227, 3042, 3122}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec ^3(c+d x) (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^n \left (A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\sin \left (c+d x+\frac {\pi }{2}\right )^3}dx\)

\(\Big \downarrow \) 2030

\(\displaystyle b^3 \int \left (b \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )\right )^{n-3} \left (C \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )^2+B \sin \left (\frac {1}{2} (2 c+\pi )+d x\right )+A\right )dx\)

\(\Big \downarrow \) 3502

\(\displaystyle b^3 \left (-\frac {\int -(b \cos (c+d x))^{n-3} (b (A (1-n)+C (2-n))+b B (1-n) \cos (c+d x))dx}{b (1-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-2}}{b d (1-n)}\right )\)

\(\Big \downarrow \) 25

\(\displaystyle b^3 \left (\frac {\int (b \cos (c+d x))^{n-3} (b (A (1-n)+C (2-n))+b B (1-n) \cos (c+d x))dx}{b (1-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-2}}{b d (1-n)}\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle b^3 \left (\frac {\int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n-3} \left (b (A (1-n)+C (2-n))+b B (1-n) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{b (1-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-2}}{b d (1-n)}\right )\)

\(\Big \downarrow \) 3227

\(\displaystyle b^3 \left (\frac {b (A (1-n)+C (2-n)) \int (b \cos (c+d x))^{n-3}dx+B (1-n) \int (b \cos (c+d x))^{n-2}dx}{b (1-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-2}}{b d (1-n)}\right )\)

\(\Big \downarrow \) 3042

\(\displaystyle b^3 \left (\frac {b (A (1-n)+C (2-n)) \int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n-3}dx+B (1-n) \int \left (b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^{n-2}dx}{b (1-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-2}}{b d (1-n)}\right )\)

\(\Big \downarrow \) 3122

\(\displaystyle b^3 \left (\frac {\frac {(A (1-n)+C (2-n)) \sin (c+d x) (b \cos (c+d x))^{n-2} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n-2}{2},\frac {n}{2},\cos ^2(c+d x)\right )}{d (2-n) \sqrt {\sin ^2(c+d x)}}+\frac {B \sin (c+d x) (b \cos (c+d x))^{n-1} \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n-1}{2},\frac {n+1}{2},\cos ^2(c+d x)\right )}{b d \sqrt {\sin ^2(c+d x)}}}{b (1-n)}-\frac {C \sin (c+d x) (b \cos (c+d x))^{n-2}}{b d (1-n)}\right )\)

input
Int[(b*Cos[c + d*x])^n*(A + B*Cos[c + d*x] + C*Cos[c + d*x]^2)*Sec[c + d*x 
]^3,x]
 
output
b^3*(-((C*(b*Cos[c + d*x])^(-2 + n)*Sin[c + d*x])/(b*d*(1 - n))) + (((A*(1 
 - n) + C*(2 - n))*(b*Cos[c + d*x])^(-2 + n)*Hypergeometric2F1[1/2, (-2 + 
n)/2, n/2, Cos[c + d*x]^2]*Sin[c + d*x])/(d*(2 - n)*Sqrt[Sin[c + d*x]^2]) 
+ (B*(b*Cos[c + d*x])^(-1 + n)*Hypergeometric2F1[1/2, (-1 + n)/2, (1 + n)/ 
2, Cos[c + d*x]^2]*Sin[c + d*x])/(b*d*Sqrt[Sin[c + d*x]^2]))/(b*(1 - n)))
 

3.4.75.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 2030
Int[(Fx_.)*(v_)^(m_.)*((b_)*(v_))^(n_), x_Symbol] :> Simp[1/b^m   Int[(b*v) 
^(m + n)*Fx, x], x] /; FreeQ[{b, n}, x] && IntegerQ[m]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3122
Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*(( 
b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2 
F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n}, x] 
 &&  !IntegerQ[2*n]
 

rule 3227
Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x 
_)]), x_Symbol] :> Simp[c   Int[(b*Sin[e + f*x])^m, x], x] + Simp[d/b   Int 
[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]
 

rule 3502
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) 
+ (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co 
s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m 
+ 2))   Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m 
 + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] 
 &&  !LtQ[m, -1]
 
3.4.75.4 Maple [F]

\[\int \left (\cos \left (d x +c \right ) b \right )^{n} \left (A +B \cos \left (d x +c \right )+C \left (\cos ^{2}\left (d x +c \right )\right )\right ) \left (\sec ^{3}\left (d x +c \right )\right )d x\]

input
int((cos(d*x+c)*b)^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x)
 
output
int((cos(d*x+c)*b)^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x)
 
3.4.75.5 Fricas [F]

\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{3} \,d x } \]

input
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, 
 algorithm="fricas")
 
output
integral((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d* 
x + c)^3, x)
 
3.4.75.6 Sympy [F(-1)]

Timed out. \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\text {Timed out} \]

input
integrate((b*cos(d*x+c))**n*(A+B*cos(d*x+c)+C*cos(d*x+c)**2)*sec(d*x+c)**3 
,x)
 
output
Timed out
 
3.4.75.7 Maxima [F]

\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{3} \,d x } \]

input
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, 
 algorithm="maxima")
 
output
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d 
*x + c)^3, x)
 
3.4.75.8 Giac [F]

\[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\int { {\left (C \cos \left (d x + c\right )^{2} + B \cos \left (d x + c\right ) + A\right )} \left (b \cos \left (d x + c\right )\right )^{n} \sec \left (d x + c\right )^{3} \,d x } \]

input
integrate((b*cos(d*x+c))^n*(A+B*cos(d*x+c)+C*cos(d*x+c)^2)*sec(d*x+c)^3,x, 
 algorithm="giac")
 
output
integrate((C*cos(d*x + c)^2 + B*cos(d*x + c) + A)*(b*cos(d*x + c))^n*sec(d 
*x + c)^3, x)
 
3.4.75.9 Mupad [F(-1)]

Timed out. \[ \int (b \cos (c+d x))^n \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x) \, dx=\int \frac {{\left (b\,\cos \left (c+d\,x\right )\right )}^n\,\left (C\,{\cos \left (c+d\,x\right )}^2+B\,\cos \left (c+d\,x\right )+A\right )}{{\cos \left (c+d\,x\right )}^3} \,d x \]

input
int(((b*cos(c + d*x))^n*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d 
*x)^3,x)
 
output
int(((b*cos(c + d*x))^n*(A + B*cos(c + d*x) + C*cos(c + d*x)^2))/cos(c + d 
*x)^3, x)